package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用工类型
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum UserBaseEmploymentType implements BaseEnum<Integer> {

    /** 用工类型-正式员工 */
    REGULAR_EMPLOYEE(1, "正式员工"),
    /** 用工类型-实习生 */
    INTERN(2, "实习生"),
    /** 用工类型-退休返聘 */
    RETIRED_REHIRED(3, "退休返聘");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static UserBaseEmploymentType getByCode(Integer code) {
        return BaseEnum.getByCode(UserBaseEmploymentType.class, code);
    }

    @JsonCreator
    public static UserBaseEmploymentType getByName(String name) {
        return BaseEnum.getByName(name, UserBaseEmploymentType.class);
    }

}
